<!--撤回案件-->

<template>
  <el-dialog title="案件需要材料补正" width="700px" :visible="visible" @close="handleClose">
    <div class="white-card">
      <div class="word">案件需要补正材料，请尽快完成材料补正操作</div>
      <el-form ref="form" :model="form" :rules="rules" label-width="130px">
        <el-form-item label="发起时间：" prop="repeatCheckReason">{{ correctInfo.initiateTime }}</el-form-item>

        <el-form-item label="补正时限：">{{ correctInfo.limitDay }} 天</el-form-item>

        <!-- <div class="dialog-footer-btn">
          <el-button @click="handleSubmit" :loading="submitting" type="primary" plain>确定补正时间</el-button>
        </div> -->
      </el-form>
    </div>
  </el-dialog>
</template>

<script>
import * as mixins from "@/utils/mixins";
import * as portalWorkOrderAPI from "@/api/portals/workOrder";
import { getCMSUserInfo } from "@/utils/common";
import * as fileApi from "@/api/file";
import uploadInput from "@/components/uploadInput/uploadInput.vue";

export default {
  name: "reconsiderationDialog",
  components: { uploadInput },
  mixins: [mixins.dialog, mixins.form],
  props: ["visible", "workOrderId", "correctInfo"],
  data() {
    return {
      fileList: [],
      uploading: false,
      form: {
        correctTime: "",
      },
      rules: {
        correctTime: [{ required: true, message: "请填写" }],
      },
      submitting: false,
    };
  },
  methods: {
    show() {
      this.form.correctTime = this.correctInfo.limitDay;
    },
    handleSubmit() {
      this.validate("form")
        .then(() => {
          const cmsUserInfo = getCMSUserInfo();
          this.submitting = true;
          return portalWorkOrderAPI.repeatCheck({
            ...this.form,
            createUser: cmsUserInfo.userId,
            workOrderId: this.workOrderId,
          });
        })
        .then(() => {
          this.$emit("success");
          this.handleClose();
          this.$alert("提交成功", "提示", { customClass: "top20" });
        })
        .finally(() => {
          this.submitting = false;
        });
    },
  },
};
</script>

<style scoped lang="less">
.word {
  margin-bottom: 20px;
}
</style>
